package com.laiyizhan.common.mapper;

import com.laiyizhan.common.model.Seventh_e;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface Seventh_eMapper {
    @Select({
            "select",
            "*",
            "from Seventh_e",
            "where hospital = #{oName,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    List<Seventh_e> selectByName(String oName);
    @Delete({
            "delete from Seventh_e",
            "where hospital = #{oName,jdbcType=VARCHAR}"
    })
    int deleteByName(String oName);
    @Delete({
        "delete from seventh_e",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into seventh_e (hospital, type, ",
        "a, b, c, ",
        "d, e)",
        "values (#{hospital,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, ",
        "#{a,jdbcType=VARCHAR}, #{b,jdbcType=VARCHAR}, #{c,jdbcType=VARCHAR}, ",
        "#{d,jdbcType=VARCHAR}, #{e,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(Seventh_e record);

    int insertSelective(Seventh_e record);

    @Select({
        "select",
        "id, hospital, type, a, b, c, d, e",
        "from seventh_e",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Seventh_e selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Seventh_e record);

    @Update({
        "update seventh_e",
        "set hospital = #{hospital,jdbcType=VARCHAR},",
          "type = #{type,jdbcType=VARCHAR},",
          "a = #{a,jdbcType=VARCHAR},",
          "b = #{b,jdbcType=VARCHAR},",
          "c = #{c,jdbcType=VARCHAR},",
          "d = #{d,jdbcType=VARCHAR},",
          "e = #{e,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Seventh_e record);

    int insertBatch(List<Seventh_e> item);
}